/**
 * 商品评论模块
 */
import request from "@/utils/httpRequest";

//创建评论
export function createCommont(data = {}) {
  return request({
    url: `/evaluate-service/back/v1/evaluate/create`,
    method: "post",
    data
  });
}

//删除评论
export function deleteCommont(data = {}) {
  return request({
    url: `/evaluate-service/back/v1/evaluate/delete`,
    method: "post",
    data
  });
}
//获取单个评论详情
export function getCommontDetail(params = {}) {
  return request({
    url: `/evaluate-service/back/v1/evaluate/get`,
    method: "get",
    params
  });
}
// 获取商品评论列表
export function getCommontList(params = {}) {
  return request({
    url: `/evaluate-service/back/v1/evaluate/list`,
    method: "get",
    params
  });
}
//设置推荐评论
export function setBestCommont(data = {}) {
  return request({
    url: `/evaluate-service/back/v1/evaluate/set-best`,
    method: "post",
    data
  });
}
// 设置排序
export function setSortComont(data = {}) {
  return request({
    url: `/evaluate-service/back/v1/evaluate/sort/update`,
    method: "post",
    data
  });
}

//新增头像
export function addAvatar(data = {}) {
  return request({
    url: `/evaluate-service/back/v1/evaluate/avatar/adds`,
    method: "post",
    data
  });
}

// 删除头像
export function deleteAvatar(data = {}) {
  return request({
    url: `/evaluate-service/back/v1/evaluate/avatar/delete`,
    method: "post",
    data
  });
}

// 获取头像列表
export function getAvatarList(data = {}) {
  return request({
    url: `/evaluate-service/back/v1/evaluate/avatar/list`,
    method: "post",
    data
  });
}
